package com.tuyan.aixiang.enums;

public enum YsDeviceType {

    CAMERA(1, "摄像头"),
    GATEWAY(2, "网关"),
    GAS(3, "丙烷"),
    SMOKE(4, "烟感"),
    UNKNOWN(999, "未知");

    Integer value;
    String name;

    YsDeviceType(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public String getName() { return name; }

    public static Integer getValueByName(String name) {
        for(YsDeviceType t: YsDeviceType.values()) {
            if(t.getName().equals(name)) {
                return t.getValue();
            }
        }
        return UNKNOWN.getValue();
    }
}
